import java.util.HashMap;
import java.util.Map;

public class RoleFactory {
    private Map<String, Role> roles=new HashMap<>();

    public Role getRole(String name) {
        Role role = roles.computeIfAbsent(name, ConcreteRole::new);
        return role;
    }
}
